package com.wangjiang.mario.admin.common.base;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 公用基础实体类父类
 */
@Data
public class BaseEntity {
    @TableField(value = "id")
    private Long id;

    @TableId(value = "uuid",type = IdType.UUID)//指定uuid
    @JsonSerialize(using= ToStringSerializer.class)
    private String uuid;

    @TableField(value = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createdTime;

    @TableField(value = "created_by_id")
    @ApiModelProperty(value = "创建人id")
    private String createdById;

    @TableField(value = "created_by_name")
    @ApiModelProperty(value = "创建人登录名")
    private String createdByName;

    @TableField(value = "updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间")
    private Date updatedTime;

    @TableField(value = "updated_by_id")
    @ApiModelProperty(value = "更新人id")
    private String updatedById;

    @TableField(value = "updated_by_name")
    @ApiModelProperty(value = "更新人登录名")
    private String updatedByName;

    // 是否删除
    @TableField(value = "del_flag")
    @ApiModelProperty(value = "是否删除")
    private Boolean delFlag;

    // 启用停用
    @TableField(value = "status")
    @ApiModelProperty(value = "启用停用")
    private Boolean status;

    // 是否系统数据
    @TableField(value = "is_system_data")
    @ApiModelProperty(value = "是否系统数据")
    private Boolean isSystemData;

    // description
    @TableField(value = "description")
    @ApiModelProperty(value = "描述")
    private String description;

    // remark
    @TableField(value = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;
}
